package com.github.liuche51.easyTask.task;


import com.github.liuche51.easyTask.core.Schedule;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Map;
import java.util.concurrent.ConcurrentLinkedQueue;

public class CusTask1 extends Schedule implements Runnable {
    private static Logger log = LoggerFactory.getLogger(CusTask1.class);
    public static ConcurrentLinkedQueue<String> queue = new ConcurrentLinkedQueue<>();
    @Override
    public void run() {
        Map<String, String> param = getParam();
        if (param != null && param.size() > 0) {
            queue.add(ZonedDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) + "  任务ID:" + this.getScheduleExt().getId() + "  名称:" + param.get("name") + " 的任务已执行!");
            log.info("任务1已执行!姓名:{} 生日:{} 年龄:{} 线程ID:{}", param.get("name"), param.get("birthday"), param.get("age"), param.get("threadid"));
        }
    }
}
